import { defHttp } from "@/utils/http";
// ERP 报表分组 VO
export interface RepGrpVO {
	groupId: number; // 主键,示例值(25205)
	groupName: string; // 报表分类名称,示例值(王五)
	parentId: number; // 父级ID,示例值(21769)
	sqNumb: number; // 序号
	qtyRatio: number; // 数量比率
	amountRatio: number; // 金额比率
}

// ERP 报表分组 API
export const RepGrpApi = {
	// 查询报表分组分页
	getRepGrpPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/hfm-report/page`, params });
	},

	// 查询报表分组详情
	getRepGrp: async (id: number) => {
		return await defHttp.get({ url: `/whs/hfm-report/get?id=` + id });
	},

	// 新增报表分组
	createRepGrp: async (data: RepGrpVO) => {
		return await defHttp.post({ url: `/whs/hfm-report/create`, data });
	},

	// 修改报表分组
	updateRepGrp: async (data: RepGrpVO) => {
		return await defHttp.put({ url: `/whs/hfm-report/update`, data });
	},

	// 删除报表分组
	deleteRepGrp: async (id: number) => {
		return await defHttp.delete({ url: `/whs/hfm-report/delete?id=` + id });
	},

	// 导出报表分组 Excel
	exportRepGrp: async (params: any) => {
		return await defHttp.download({ url: `/whs/hfm-report/export-excel`, params });
	}
};
